﻿
//	------------------------------------------------------------------------------
//                                       _                          
//              _ __ ___   ___ _ __ ___ | |__  _ __ __ _ _ __   ___ 
//             | '_ ` _ \ / _ \ '_ ` _ \| '_ \| '__/ _` | '_ \ / _ \
//             | | | | | |  __/ | | | | | |_) | | | (_| | | | |  __/
//             |_| |_| |_|\___|_| |_| |_|_.__/|_|  \__,_|_| |_|\___|
//                                                     
//	------------------------------------------------------------------------------

#region - License -
//
//	------------------------------------------------------------------------------                                                   
//	         Copyright (c) 2010 Peter Vyvey (peter.vyvey@chiliware.be)
//	------------------------------------------------------------------------------
//
//
//	This file is part of CHILIWARE MEMBRANE.
//
//	CHILIWARE MEMBRANE is free software: you can redistribute it and/or modify
//	it under the terms of the GNU Lesser General Public License as published by
//	the Free Software Foundation, either version 3 of the License, or
//	(at your option) any later version.
//
//	CHILIWARE MEMBRANE is distributed in the hope that it will be useful,
//	but WITHOUT ANY WARRANTY; without even the implied warranty of
//	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//	GNU Lesser General Public License for more details.
//
//	You should have received a copy of the GNU Lesser General Public License
//	along with CHILIWARE MEMBRANE.  If not, see <http://www.gnu.org/licenses/>.
//
//
#endregion

#region - Changes -
//
//	peter.vyvey@chiliware.be		2010-08-09		Created
//
#endregion

#region - Using -

using System;
using System.Runtime.Serialization;
using Chiliware.Membrane.Extension;

#endregion

namespace Chiliware.Membrane.ExceptionManagement
{
    #region - SessionException -

	/// <summary>
	/// Represents a exception related to the session management.
	/// </summary>
    public class SessionException : ApplicationModelException
	{
		#region - Constructors -

		/// <summary>
		/// Initializes a new instance of the WrappedException class.
		/// </summary>
        public SessionException() : base() { }

        /// <summary>
        /// Initializes a new instance of the WrappedException class.
        /// </summary>
        /// <param name="number">The exception type that will escalate to the presentation layer.</param>
        public SessionException(ExceptionNumber number)
            : base(number, string.Format("{0} (Result: 0x{1})", number.ToString().Humanize(), Enum.Format(typeof(ExceptionNumber), number, "x"))) { }

		/// <summary>
		///  Initializes a new instance of the WrappedException class with a specified error message.
		///  </summary>
		/// <param name="message"> The message that describes the error.</param>
        public SessionException(string message)
            : base(message) { }

        /// <summary>
        /// Initializes a new instance of the WrappedException class with a specified error message.
		/// </summary>
        /// <param name="number">The exception type that will escalate to the presentation layer.</param>
        /// <param name="message"> The message that describes the error.</param>
        public SessionException(ExceptionNumber number, string message)
            : base(number, message) { }

		/// <summary>
		/// Initializes a new instance of the WrappedException class with a specified
		/// error message and a reference to the inner exception that is the cause of
		/// this exception.
		/// </summary>
		/// <param name="message">The error message that explains the reason for the exception.</param>
		/// <param name="innerException">The exception that is the cause of the current exception, or a null reference if no inner exception is specified.</param>
        public SessionException(string message, Exception innerException)
            : base(message, innerException) { }

        /// <summary>
        /// Initializes a new instance of the WrappedException class with a specified
        /// error message and a reference to the inner exception that is the cause of
        /// this exception.
        /// </summary>
        /// <param name="number">The exception type that will escalate to the presentation layer.</param>
        /// <param name="message">The error message that explains the reason for the exception.</param>
        /// <param name="innerException">The exception that is the cause of the current exception, or a null reference if no inner exception is specified.</param>
        public SessionException(ExceptionNumber number, string message, Exception innerException)
            : base(number, message, innerException) { }

		/// <summary>
		/// Initializes a new instance of the WrappedException class with serialized
		/// data.
		/// </summary>
		/// <param name="info">The System.Runtime.Serialization.SerializationInfo that holds the serialized object data about the exception being thrown.</param>
		/// <param name="context">The System.Runtime.Serialization.StreamingContext that contains contextual information about the source or destination.</param>
        protected SessionException(SerializationInfo info, StreamingContext context)
            : base(info, context) { }

		#endregion
	}

	#endregion
}
